<template>
<div class="paper-item-cp">
    <img 
        class="picture"
        src="https://file.dumogu.top/blog_mine.jpg?imageView2/1/w/300/h/300/q/75"
        alt="哈哈哈">
    <div>
        啊实打实大阿萨德asdasd
    </div>
</div>
</template>
<script>
import {isClient} from "~/common/OtherTools";
export default { 
    data(){ 
        return{ 
            essay:{},
            dailyessay:{},  //屏幕上显示的内容
            date:'',  //当前时间
            dataInfo:`## 网站大更新↵**经过一番更新，网站速度得到了明显提升，可以秒级刷新，快的使我兴奋，这是用seo换来的，毕竟鱼和熊掌不可兼得也。**↵↵**马上就是国庆咯，刚过中秋就过国庆，网站也更新了，就差国庆换服务器了，唉，钱是哗哗哗往下掉啊，没办法，就这点爱好。**↵↵更新的站点↵↵[毒蘑菇搜索](https://search.dumogu.top)↵↵[毒蘑菇配色](https://color.dumogu.top)`,
        }
    },
    asyncData(context){
        if(isClient()) return; //在服务端运行时才触发
        console.log(1);
        console.log(Api.login());
        console.log(2);
    },
    created(){
        if(!isClient()) return;
        this.getDate();
        if(this.dailyessay.essay_id) return;
        this.getData();
    },
    methods:{
        goPage(id){
            this.$router.push("/essay/"+id);  
        },
        getData(){
            this.$axios.$Api.getDailyEssay().then((data)=>{
                this.essay = data;
                this.essay.id = data.essay_id;
                this.dailyessay = data;
            });
        },
        getDate(){ //获取当前时间
            var now = new Date();
            this.date = now.getFullYear() +"-"+ (now.getMonth()+1) +"-"+ now.getDate();
        },
    },
}
</script>
<style lang='scss' scoped>
.paper-item-cp{
    width:fit-content;
    height: fit-content;
    box-sizing: border-box;
    padding: 5px;
    display: grid;
    grid-gap:5px;
    grid-template-columns: min-content 1fr;
    background-color: beige;
    align-items: center;
    border-radius: 5px;
    font-weight: 500;
    cursor: pointer;
    >img{
        width: 30px;
        height: 30px;
        border-radius: 50%;
        border: 1px solid #000000;
    }
    >div{
        font-size: 15px;
        color: rgb(204, 204, 204);
    }
}
</style>